package sectorCrack;

import java.util.ArrayList;

import sectorCrack.bean.Dat;
import sectorCrack.bean.JobConfig;
import sectorCrack.manager.DataExtracter;
import sectorCrack.process.SectorQCProcessor;
import sectorCrack.utils.ByteFileCreator;
import sectorCrack.utils.TextFileCreator;

public class JobRunner {
	public final static String FILENAME = "g07la_D7101D0000.dat";

	/**
	 * @param args
	 */
	public static void main(String[] args) {

//		for (int i = 0; i < args.length; i++) {
//			System.out.println(i + ": " + args[i]);
//		}
		try {
			for (String filename : args) {
				System.out.println("reading: " + filename);
				ArrayList<Dat> data = new DataExtracter(filename).doExtract();
				TextFileCreator.createFile(data, filename + ".orgTxt");
				new SectorQCProcessor(data, new JobConfig()).process();
				ByteFileCreator.createFile(data, filename + ".qcDat");
				TextFileCreator.createFile(data, filename + ".qcTxt");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println("ok");
	}

}
